package demo_0319;

import java.util.Arrays;

public class Test02 {
    public static void main(String[] args) {
        RectangleV2[] rectangles = new RectangleV2[10];

        // 创建10个矩形对象并存储到数组中
        rectangles[0] = new RectangleV2(5, 10);
        rectangles[1] = new RectangleV2(8, 12);
        rectangles[2] = new RectangleV2(3, 7);
        rectangles[3] = new RectangleV2(10, 15);
        rectangles[4] = new RectangleV2(6, 9);
        rectangles[5] = new RectangleV2(4, 8);
        rectangles[6] = new RectangleV2(7, 11);
        rectangles[7] = new RectangleV2(9, 14);
        rectangles[8] = new RectangleV2(2, 5);
        rectangles[9] = new RectangleV2(11, 18);

        Arrays.sort(rectangles);
        for(RectangleV2 r:rectangles){
            r.print();
        }
    }
}
